// @/utils/auth.js
import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  // 建议设置较短的有效期
  return Cookies.set(TokenKey, token, {
    expires: 1, // 1天
    sameSite: 'Strict'
  })
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
